check if a file exists rust

248

check if a file exists rust -

use std::path::Path;

fn main() {
    println!("{}", Path::new("/etc/hosts").exists());
}

Comments

Submit
0 Comments